﻿namespace GreenIsomer.Web.Controls.JQuery {
	using System;
	using System.Text;
	using System.Web;

	/// <summary>
	/// Defines the contract needed by the jQuery Manager control to render unified events, scripts and styles.
	/// </summary>
	/// <seealso cref="Manager"/>
	public interface IJQueryControl {


		#region Properties

		/// <summary>
		/// Gets a value of whether or not the control is to be rendered as UI on the page.
		/// </summary>
		bool Visible { get; }

		/// <summary>
		/// Gets or sets a value instructing the server control not to render style defined as HTML attributes on the element, rather requiring the site's stylesheet to handle functionality required to properly render the client UI.
		/// This value can be overridden at the GreenIsomer.Web.Controls.JQuery.Manager level rather than setting each individual control.
		/// </summary>
		bool UseCssStyling { get; set; }

		#endregion


		#region Methods

		/// <summary>
		/// Renders the load script required to generate the client-side jQuery widget.
		/// This method is used primarily by control developers.
		/// </summary>
		/// <param name="script">A GreenIsomer.Web.Controls.JQuery.ScriptBuilder that creates the output stream to render jQuery JavaScript on the client.</param>
		void RenderLoadScript(ScriptBuilder script);

		/// <summary>
		/// Renders the jQuery "Ready Event" script required to generate the client-side jQuery widget.
		/// This method is used primarily by control developers.
		/// </summary>
		/// <param name="script">A GreenIsomer.Web.Controls.JQuery.ScriptBuilder that creates the output stream to render jQuery JavaScript on the client.</param>
		void RenderReadyScript(ScriptBuilder script);

		#endregion


	}

}